<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>留言板</title>
    <link rel="stylesheet" href="../css/03app.css">
    <style>
        .container{
            width: 70%;
            margin: auto;
            display: flex;
            flex-direction: column;
        }
        a{
            text-decoration: none;
            color: #baf;
        }
        button{
            width: 100px;
            height: 30px;

        }
        .hr{
            margin-top: 15px;
            margin-bottom: 15px;
            height: 1px;
            background-color: silver;
        }
        ul{
            padding: 0;
            margin: 0;
            list-style: none;
        }
        ul li{
            border: 1px solid silver;
            border-top: none;
            border-radius: 2px;
            /* margin-top: 5px; */
            padding: 10px;
            display: flex;
            justify-content: space-between;
            font-size: 16px;
        }
        ul li:nth-child(1){
            border-top: 1px solid silver;
        }
    </style>
</head>
<body>
    <div class="container">
        <a href="/"><h2>留言板</h2></a>
        <a href="/post"><button>发表留言</button></a>
        <div class="hr"></div>
        <ul>
            {{ each comments }}
            <li>
                <span>
                    <span>{{ $value.name }}:</span>
                    <span>{{ $value.message }}</span>
                </span>
                <span>{{ $value.date }}</span>
                
            </li>
            {{ /each }}
        </ul>
    </div>  
</body>
</html>